#include "SQLDropOutlineStatement.h"

#include "SQLDDLStatement.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../SQLName.h"
#include "../../../DbType.h"
#include "../../../utils/instanceof.h"

SQLDropOutlineStatement::SQLDropOutlineStatement()
{
}

SQLDropOutlineStatement::SQLDropOutlineStatement(DbType_ptr  dbType)
    : SQLStatementImpl(dbType)
{
}

void SQLDropOutlineStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLDropOutlineStatement)))
  {
    acceptChild(visitor, name);
  }
  visitor->endVisit(SharedObject(SQLDropOutlineStatement));
}

SQLName_ptr SQLDropOutlineStatement::getName()
{
  return name;
}

void SQLDropOutlineStatement::setName(SQLName_ptr x)
{
  if (x != NULL)
  {
    x->setParent(SharedObject(SQLDropOutlineStatement));
  }
  this->name = x;
}

BOOL_ptr SQLDropOutlineStatement::isIfExists()
{
  return ifExists;
}

void SQLDropOutlineStatement::setIfExists(BOOL_ptr ifExists)
{
  this->ifExists = ifExists;
}

SQLObject_list_ptr  SQLDropOutlineStatement::getChildren()
{
  SQLObject_list_ptr  children = std::make_shared<std::list<SQLObject_ptr>>();
  if (name != NULL)
  {
    children->push_back(std::dynamic_pointer_cast<SQLObject>(name));
  }
  return children;
}
